MOOC Utils

Utils like auto assignment solver extension and course notice announcment notification for MOOC courses

Usage guide

Introduction#

Day-to-day use of Assignment Solver on NPTEL and SWAYAM. Manual Mode for learning, Auto Mode for full automation, supported question types, settings, and habits that keep you out of trouble with rate limits.

Project structure#

The extension consists of:

  • A side panel UI (React-like structure in HTML/CSS/JS) for user controls
  • A background service worker orchestrating tasks and messaging
  • A content script interacting with the assignment page
  • Services for Gemini AI integration and local storage
  • Platform adapters for cross-browser compatibility

Core components#

  • UI entry and initialization: Sets up logging, adapters, services, state, and controllers; waits for background readiness; initializes event listeners and assignment detection.
  • Controllers:
  • Solve controller: Orchestrates extraction, AI solving, answer filling, and optional submission.
  • Settings controller: Manages API key and model preferences.
  • Detection controller: Determines if the current page is an assignment and updates UI accordingly.
  • Background worker: Routes messages to appropriate handlers, manages panel behavior, and coordinates with content script.
  • Content script: Extracts page HTML/images, applies answers, and submits forms.
  • Gemini service: Builds prompts, attaches images/screenshots, and calls the Gemini API.
  • Platform adapters: Unified browser API access for Chrome/Firefox.

Architecture overview#

End-to-end flow from UI to page automation:

Detailed component analysis#

Manual Mode lets you review each question, get hints, choose answers, and apply them one by one.

Basic steps:

  1. Navigate to an assignment page on a supported MOOC platform.
  2. Open the extension side panel.
  3. Click Extract Questions to scan the page.
  4. Click on a question to view details.
  5. Click Get Study Hints to receive:
  • Key concepts being tested
  • Elimination tips for wrong answers
  • Common traps to avoid
  • What to verify before answering
  1. Select your answer in the side panel.
  2. Click Apply Answer to Page to fill it on the actual page.
  3. Click Back to List and repeat for other questions.
  4. When done, click Submit Assignment Only.

Supported question types:

  • Single Choice: Radio button questions
  • Multi Choice: Checkbox questions
  • Fill-in-the-Blank: Text/number input fields

Auto mode (full automation)#

Auto Mode automatically solves all questions, fills answers, and submits (optional).

Basic steps:

  1. Navigate to an assignment page.
  2. Open the extension side panel.
  3. Click Extract Questions to scan the page.
  4. Click Solve All + Submit.
  5. Confirm the action when prompted.
  6. Wait for the process to complete:
  • AI analyzes each question
  • Answers are filled on the page
  • Submit button is clicked automatically
  1. Review the summary and check the page.

Supported question types and application#

  • Single Choice: The content script clicks the correct radio button.
  • Multi Choice: The content script checks all correct checkboxes and unchecks wrong ones.
  • Fill-in-the-Blank: The content script types the answer and triggers input/change events.

Configuration options#

  • API Key Management:
  • Store your Gemini API key in the Settings modal.
  • The key is persisted locally and never sent to third-party servers.
  • Model Selection:
  • Choose extraction and solving models from the Settings modal.
  • Adjust reasoning levels for extraction and solving.
  • Auto-Submit:
  • Toggle Auto-submit answers in the main panel.

Best practices for optimal results#

  • Use Manual Mode for learning: Review AI hints and reasoning to understand concepts.
  • Keep the assignment page fully loaded before extracting.
  • Prefer stable models for extraction and higher-performance models for solving.
  • If rate limits occur, reduce concurrent operations or upgrade your API quota.
  • For platforms with custom UI components, apply answers one by one to isolate issues.

Dependency analysis#

  • UI depends on:
  • State manager for processing flags and extraction data
  • Settings controller for API key and model preferences
  • Progress controller for step tracking
  • Detection controller for assignment presence
  • Background worker depends on:
  • Message routing to handlers
  • Panel adapter for opening the side panel
  • Gemini service for AI requests
  • Content script handlers for DOM operations
  • Content script depends on:
  • Extractor for page HTML and images
  • Applicator for applying answers and submitting

Performance considerations#

  • Rate limiting:
  • 500 ms delay between answer API calls
  • 200 ms delay between DOM operations
  • Recursive splitting:
  • Extraction and solving are retried with smaller chunks when exceeding token limits.
  • Image and screenshot handling:
  • Large images are skipped to avoid API size limits.
  • Model selection:
  • Choose models aligned with your needs and quotas.

Troubleshooting guide#

Common issues and resolutions:

  • Could not get page HTML:
  • Ensure you are on an actual assignment page and it is fully loaded.
  • Refresh the page and re-extract.
  • Question container not found:
  • Re-extract questions; check console for detailed error info.
  • API Key invalid:
  • Verify your key at Google AI Studio and ensure it has Gemini API access enabled.
  • Answers not being applied:
  • Some platforms use custom input components; check browser console for errors.
  • Apply answers one at a time to identify problematic questions.
  • Rate limit errors:
  • Wait a few minutes before retrying.
  • Consider upgrading your API quota or reducing the number of questions per session.

Conclusion#

Prefer Manual Mode while you learn a course. Auto Mode is fine after you have checked a few answers by hand.

Appendices#

Installation and setup#

  • Install the extension from the Chrome Web Store or load it manually from GitHub releases.
  • After installation, open the side panel, go to Settings, enter your Gemini API key, and save.

UI controls reference#

  • Main panel:
  • Solve Assignment: Start the full automation pipeline.
  • Auto-submit answers: Toggle automatic submission.
  • Settings modal:
  • Gemini API Key: Enter your API key.
  • Extraction Model and Solving Model: Choose models and reasoning levels.
  • Progress steps:
  • Extract → Analyze → Fill → Submit